<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // es5合并对象
        const obj1 = {
            a: 1,
            b: 1.5,
        };
        const obj2 = {
            b: 2,
        };

        // ES6合并对象
        // 对象解构
        const obj = {
            ...obj1,
            ...obj2,
        }

        console.log(obj);

        const a = [1, 2, 3];
        const b = [3, 4, 5]

        const expect = [1, 2, 3, 3, 4, 5];
        // es5
        const c = a.concat(b);
        console.log(c);
        // es6
        const c1 = [...a, ...b];
        console.log(c1);

    </script>
</body>
</html>